<?php
$pid = pcntl_fork();
if ($pid<0){
    exit('fork error');
}else if ($pid>0){
    exit();
}
if (!posix_setsid()){
    exit('setsid error');
}
$pid = pcntl_fork();
if ($pid<0){
    exit('fork error');
}else if ($pid>0){
    exit;
}
cli_set_process_title("test123");
for ($i=1;$i<=1000;$i++){
    sleep(1);
    echo "test".PHP_EOL;
}
